package itdep.ui;

import itdep.jsf.internal.JSFUtils;

import javax.faces.model.SelectItem;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

public class TranslationBean {
	private static long genId = 100L;

	public List<SelectItem> getLocaleSelectItems() {
		final List<SelectItem> items = new ArrayList<SelectItem>();
		for (Locale locale : JSFUtils.getSupportedLocales()) {
			items.add(new SelectItem(locale.toString()));
		}
		return items;
	}

	public Locale getLocale() {
		return JSFUtils.getLocale();
	}

	public String getNewId() {
		return "generated" + String.valueOf(++genId);
	}
}